/**
 * 
 */
package edu.ou.cs.youming.jaxb.types;

import java.util.Map;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import edu.ou.cs.youming.agents.Agent;

/**
 * @author Youming Lin
 * 
 */
@XmlRootElement(name = "Results")
public final class Results {
	@XmlElement(name = "Training Distribution")
	public final Map<Label, Integer> tSetDist;

	@XmlElement(name = "Validation Distribution")
	public final Map<Label, Integer> vSetDist;

	@XmlElement(name = "Prediction Distribution")
	public final Map<Label, Integer> pDist;

	@XmlElement(name = "Agent")
	public final Agent agent;

	protected Results() {
		tSetDist = null;
		vSetDist = null;
		pDist = null;
		agent = null;
	}

	public Results(final Map<Label, Integer> tSetDist,
			final Map<Label, Integer> vSetDist, final Map<Label, Integer> pDist,
			final Agent agent) {
		if (tSetDist == null) {
			throw new NullPointerException("training set distribution");
		}

		if (vSetDist == null) {
			throw new NullPointerException("validation set distribution");
		}

		if (agent == null) {
			throw new NullPointerException("agent");
		}

		this.tSetDist = tSetDist;
		this.vSetDist = vSetDist;
		this.pDist = pDist;
		this.agent = agent;
	}
}